Index: webapp/cms/plugins/web/pages/services/explorer-folder/common/files_3.3.xsl
===================================================================
--- webapp/cms/plugins/web/pages/services/explorer-folder/common/files_3.3.xsl	(revision 0)
+++ webapp/cms/plugins/web/pages/services/explorer-folder/common/files_3.3.xsl	(revision 0)
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Copyright 2010 Anyware Services
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+   -->
+<xsl:stylesheet version="1.0" 
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+                xmlns:resolver="org.ametys.cms.transformation.xslt.ResolveURIComponent"
+                xmlns:filenameutils="org.apache.commons.io.FilenameUtils"
+                xmlns:ametys="org.ametys.web.transformation.xslt.AmetysXSLTHelper"
+                xmlns:math="http://exslt.org/math"
+                extension-element-prefixes="resolver filenameutils">
+
+  	<xsl:import href="service:web://pages/services/common.xsl"/>
+
+    <xsl:param name="header" select="ametys:serviceParameter('header')"/>
+    
+    <!-- Used in common.xsl -->
+    <xsl:variable name="is-empty" select="not(/Node)"/>    
+    <xsl:variable name="common-service-name">service-explorer-folder</xsl:variable>  
+    
+    <xsl:variable name="id" select="concat('attachment_', substring-after(math:random(), '.'))"/>    
+
+    <!-- +
+         | HEAD
+         + -->   
+    <xsl:template name="common-service-head-title">
+       	<xsl:call-template name="common-service-head-title-content">
+            <xsl:with-param name="title" select="$header"/>                    
+        </xsl:call-template>
+    </xsl:template>
+        
+    
+    <!-- +
+     | BODY
+     + -->    
+     	
+    <!-- Used in common.xsl -->         
+    <xsl:template name="common-service-body-empty">
+        <i18n:text i18n:key="ATTACHMENTS_NO_FILE"/>
+    </xsl:template>     
+
+    <!-- Used in common.xsl --> 
+    <xsl:template name="common-service-body-nonempty-content-title">
+  		<xsl:call-template name="common-service-body-nonempty-content-title-content">
+            <xsl:with-param name="title" select="$header"/>
+        </xsl:call-template>
+    </xsl:template>
+
+    <!-- Used in common.xsl --> 
+    <xsl:template name="common-service-body-nonempty-content-content">
+        <xsl:call-template name="attachment-list"/>
+    </xsl:template>
+
+    <xsl:template name="attachment-list">
+        <ul id="{$id}" class="attachment-list">
+            <xsl:apply-templates select="Node[@type = 'collection']">
+                <xsl:sort select="@name"/>
+            </xsl:apply-templates>
+            
+            <xsl:apply-templates select="Node[@type = 'resource']">
+                <xsl:sort select="@name"/>
+            </xsl:apply-templates>
+
+        </ul>
+    </xsl:template>
+
+    <xsl:template match="Node[@type = 'collection' and parent::*]">
+        <li>
+            <xsl:call-template name="FolderIcon"/>
+            
+            <span class="folder"><xsl:value-of select="@name"/></span><br/>
+            
+            <xsl:if test="Node">
+                <ul>
+                    <xsl:apply-templates select="Node[@type = 'collection']">
+                        <xsl:sort select="@name"/>
+                    </xsl:apply-templates>
+                    
+                    <xsl:apply-templates select="Node[@type = 'resource']">
+                        <xsl:sort select="@name"/>
+                    </xsl:apply-templates>
+                </ul>
+            </xsl:if>
+            
+        </li>
+    </xsl:template>
+
+    <xsl:template match="Node[@type = 'resource']">
+        <li>
+            <span class="file">
+                <a href="{resolver:resolve('explorer', @id, true())}" title="{@name} ({@size})">
+					<xsl:call-template name="Icons"/>
+                    <xsl:value-of select="@name"/>
+                </a>
+                <span class="size"><xsl:call-template name="format-size"><xsl:with-param name="size" select="@size"/></xsl:call-template></span>   
+                <xsl:call-template name="DublinCore"/>         
+            </span>        
+        </li>
+    </xsl:template>
+    
+    <xsl:template name="format-size">
+        <xsl:param name="size"/>
+        
+        <xsl:choose>
+            <xsl:when test="$size &lt; 1024">
+                <i18n:translate>
+                    <i18n:text i18n:key="ATTACHMENTS_FILE_SIZE_BYTES" i18n:catalogue="plugin.web"/>
+                    <i18n:param><xsl:value-of select="$size"/></i18n:param>
+                </i18n:translate>
+            </xsl:when>
+            <xsl:when test="$size &lt; (1024 * 1024)">
+                <i18n:translate>
+                    <i18n:text i18n:key="ATTACHMENTS_FILE_SIZE_KB" i18n:catalogue="plugin.web"/>
+                    <i18n:param><xsl:value-of select="round($size div 1024)"/></i18n:param>
+                </i18n:translate>
+            </xsl:when>
+            <xsl:otherwise>
+                <i18n:translate>
+                    <i18n:text i18n:key="ATTACHMENTS_FILE_SIZE_MB" i18n:catalogue="plugin.web"/>
+                    <i18n:param><xsl:value-of select="round($size div (1024 * 1024))"/></i18n:param>
+                </i18n:translate>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+    
+    <xsl:template name="DublinCore"/>
+
+</xsl:stylesheet>
Index: webapp/cms/plugins/web/pages/services/explorer-folder/files-tree.xsl
===================================================================
--- webapp/cms/plugins/web/pages/services/explorer-folder/files-tree.xsl	(revision 0)
+++ webapp/cms/plugins/web/pages/services/explorer-folder/files-tree.xsl	(revision 0)
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Copyright 2010 Anyware Services
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+   -->
+<xsl:stylesheet version="1.0" 
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+                xmlns:resolver="org.ametys.cms.transformation.xslt.ResolveURIComponent"
+                xmlns:ametys="org.ametys.web.transformation.xslt.AmetysXSLTHelper"
+                xmlns:filenameutils="org.apache.commons.io.FilenameUtils"
+                xmlns:math="http://exslt.org/math"
+                extension-element-prefixes="resolver filenameutils math">
+    
+    <xsl:import href="files.xsl"/>
+    
+    <xsl:param name="contextPath" select="ametys:uriPrefix()"/>
+    <xsl:param name="header" select="ametys:serviceParameter('header')"/>
+    
+    <xsl:template match="/Node">
+        
+        <xsl:variable name="id" select="concat('attachment_', substring-after(math:random(), '.'))"/>
+        
+        <html>
+            <head>
+                <link rel="stylesheet" type="text/css" href="{ametys:pluginResourceURL('web', 'css/service/tree.css')}" />
+                
+                <script type="text/javascript" src="{ametys:pluginResourceURL('web', 'js/jquery.treeview.min.js')}"><xsl:comment>empty</xsl:comment></script>
+                
+                <script type="text/javascript">
+                    $j(document).ready(function(){$j("#<xsl:value-of select="$id"/>").treeview();});
+                </script>
+            </head>
+            <body>
+                <xsl:if test="$header != ''">
+                    <h1><xsl:value-of select="$header"/></h1>
+                </xsl:if>
+                
+                <div class="attachment-list">
+                    <xsl:choose>
+	                    <xsl:when test="not(Node)">
+	                   		<span class="hint"><i18n:text i18n:key="ATTACHMENTS_NO_FILE" i18n:catalogue="plugin.web"/></span>
+	                   	</xsl:when>
+	                    <xsl:otherwise>
+		                    <ul id="{$id}" class="filetree">
+		                    
+		                        <xsl:apply-templates select="Node[@type = 'collection']">
+		                            <xsl:sort select="@name"/>
+		                        </xsl:apply-templates>
+		                        
+		                        <xsl:apply-templates select="Node[@type = 'resource']">
+		                            <xsl:sort select="@name"/>
+		                        </xsl:apply-templates>
+		                    </ul>
+	                    </xsl:otherwise>
+                    </xsl:choose>
+                </div>
+            </body>
+        </html>
+    </xsl:template>
+    
+    <xsl:template match="Node[@type = 'resource']">
+        <li>
+            <span class="file">
+                <a class="download-file" href="{resolver:resolve('explorer', @id, true())}" title="Télécharger {@name} ({size})">
+                    <img class="icon" alt="">
+                        <xsl:attribute name="src">
+                            <xsl:value-of select="$contextPath"/>
+                            <xsl:text>/plugins/explorer/icon/</xsl:text>
+                            <xsl:value-of select="filenameutils:getExtension(@name)"/>
+                            <xsl:text>.png</xsl:text>
+                        </xsl:attribute>
+                    </img>
+                    
+                    <xsl:value-of select="@name"/>
+                </a>
+<!--                <span class="size"><xsl:text> </xsl:text>(<xsl:value-of select="size"/>)</span>-->
+                <span class="size">
+                    <xsl:text> (</xsl:text>
+                    <xsl:call-template name="format-size">
+                        <xsl:with-param name="size" select="@size"/>
+                    </xsl:call-template>
+                    <xsl:text>)</xsl:text>
+                </span>
+            </span>
+        </li>
+    </xsl:template>
+    
+    <xsl:template match="Node[@type = 'collection']">
+        
+        <li class="closed">
+            <span class="folder">
+                <xsl:value-of select="@name"/>
+            </span>
+            
+            <xsl:if test="Node">
+                <ul>
+                    <xsl:apply-templates select="Node[@type = 'collection']">
+                        <xsl:sort select="@name"/>
+                    </xsl:apply-templates>
+                    
+                    <xsl:apply-templates select="Node[@type = 'resource']">
+                        <xsl:sort select="@name"/>
+                    </xsl:apply-templates>
+                </ul>
+            </xsl:if>
+        </li>
+    </xsl:template>
+    
+</xsl:stylesheet>
Index: webapp/cms/plugins/web/pages/services/explorer-folder/files.xsl
===================================================================
--- webapp/cms/plugins/web/pages/services/explorer-folder/files.xsl	(revision 0)
+++ webapp/cms/plugins/web/pages/services/explorer-folder/files.xsl	(revision 0)
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Copyright 2010 Anyware Services
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+   -->
+<xsl:stylesheet version="1.0" 
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+                xmlns:resolver="org.ametys.cms.transformation.xslt.ResolveURIComponent"
+                xmlns:ametys="org.ametys.web.transformation.xslt.AmetysXSLTHelper"
+                xmlns:filenameutils="org.apache.commons.io.FilenameUtils"
+                extension-element-prefixes="resolver filenameutils">
+
+    <xsl:param name="contextPath" select="ametys:uriPrefix()"/>
+    <xsl:param name="header" select="ametys:serviceParameter('header')"/>
+    
+    <xsl:template match="/Node">
+        <html>
+            <head>
+                <link rel="stylesheet" type="text/css" href="{ametys:pluginResourceURL('web', 'css/service/attach.css')}" />
+            </head>
+            <body>
+                <div class="attachments-wrapper">
+                
+                    <xsl:if test="$header != ''">
+                        <h1><xsl:value-of select="$header"/></h1>
+                    </xsl:if>
+                    
+                    <div class="attachment-list">
+                    	<xsl:choose>
+	                    	<xsl:when test="not(.//Node[@type = 'resource'])">
+	                    		<span class="hint"><i18n:text i18n:key="ATTACHMENTS_NO_FILE" i18n:catalogue="plugin.web"/></span>
+	                    	</xsl:when>
+	                    	<xsl:otherwise>
+		                        <xsl:apply-templates select="Node[@type = 'collection']">
+		                            <xsl:with-param name="indent" select="0"/>
+		                            <xsl:sort select="@name"/>
+		                        </xsl:apply-templates>
+		                        
+		                        <xsl:apply-templates select="Node[@type = 'resource']">
+		                            <xsl:with-param name="indent" select="0"/>
+		                            <xsl:sort select="@name"/>
+		                        </xsl:apply-templates>
+		                     </xsl:otherwise>
+                        </xsl:choose>
+                    </div>
+                </div>
+            </body>
+        </html>
+    </xsl:template>
+    
+    <xsl:template match="Node[@type = 'collection']">
+        <xsl:param name="indent">0</xsl:param>
+        
+        <xsl:if test=".//Node[@type = 'resource']">
+	        <div class="folder" style="padding-left: {$indent}px">
+	            <xsl:choose>
+	                <xsl:when test="node">
+	                    <img class="icon" src="{ametys:pluginResourceURL('web', 'img/service/folder_32.png')}" style="vertical-align: middle" alt=""/>
+	                </xsl:when>
+	                <xsl:otherwise>
+	                    <img class="icon" src="{ametys:pluginResourceURL('web', 'img/service/folder_empty_32.png')}" style="vertical-align: middle" alt=""/>
+	                </xsl:otherwise>
+	            </xsl:choose>
+	            <span class="title"><xsl:value-of select="@name"/></span><br/>
+	            
+	            <xsl:apply-templates select="Node[@type = 'collection']">
+	                <xsl:with-param name="indent" select="32"/>
+	                <xsl:sort select="@name"/>
+	            </xsl:apply-templates>
+	            
+	            <xsl:apply-templates select="Node[@type = 'resource']">
+	                <xsl:with-param name="indent" select="32"/>
+	                <xsl:sort select="@name"/>
+	            </xsl:apply-templates>
+	            
+	        </div>
+		</xsl:if>
+    </xsl:template>
+    
+    <xsl:template match="Node[@type = 'resource']">
+        <xsl:param name="indent"/>
+        
+        <div class="file" style="padding-left: {$indent}px">
+            <img class="icon" alt="">
+                <xsl:attribute name="src">
+                    <xsl:value-of select="$contextPath"/>
+                    <xsl:text>/plugins/explorer/icon-medium/</xsl:text>
+                    <xsl:value-of select="filenameutils:getExtension(@name)"/>
+                    <xsl:text>.png</xsl:text>
+                </xsl:attribute>
+            </img>
+            <a href="{resolver:resolve('explorer', @id, true())}" title="Télécharger {@name}"><xsl:value-of select="@name"/></a>
+            <br/>
+            <span class="size">
+                <xsl:call-template name="format-size">
+                    <xsl:with-param name="size" select="@size"/>
+                </xsl:call-template>
+            </span>
+        </div>
+    </xsl:template>
+    
+    <xsl:template name="format-size">
+        <xsl:param name="size"/>
+        <xsl:choose>
+            <xsl:when test="$size &lt; 1024">
+                <i18n:translate>
+                    <i18n:text i18n:key="ATTACHMENTS_FILE_SIZE_BYTES" i18n:catalogue="plugin.web"/>
+                    <i18n:param><xsl:value-of select="$size"/></i18n:param>
+                </i18n:translate>
+            </xsl:when>
+            <xsl:when test="$size &lt; (1024 * 1024)">
+                <i18n:translate>
+                    <i18n:text i18n:key="ATTACHMENTS_FILE_SIZE_KB" i18n:catalogue="plugin.web"/>
+                    <i18n:param><xsl:value-of select="round($size div 1024)"/></i18n:param>
+                </i18n:translate>
+            </xsl:when>
+            <xsl:otherwise>
+                <i18n:translate>
+                    <i18n:text i18n:key="ATTACHMENTS_FILE_SIZE_MB" i18n:catalogue="plugin.web"/>
+                    <i18n:param><xsl:value-of select="round($size div (1024 * 1024))"/></i18n:param>
+                </i18n:translate>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+
+</xsl:stylesheet>
